package com.xaicode.utils;

import java.util.concurrent.ThreadLocalRandom;

/**
 * Random
 *
 * @author beborn xaicode@sina.com
 */
public class Random {

    public static final int[] INT_ARR_0_9 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

    /**
     * 用于随机选的数字
     */
    public static final String BASE_NUMBER = "0123456789";
    /**
     * 用于随机选的字符
     */
    public static final String BASE_CHAR = "abcdefghijklmnopqrstuvwxyz";
    /**
     * 用于随机选的字符和数字
     */
    public static final String BASE_CHAR_NUMBER = BASE_CHAR + BASE_NUMBER;

    public static ThreadLocalRandom getRandom() {
        return ThreadLocalRandom.current();
    }

    public static <T> T[] array(int num, Class<T> t) {
        return null;
    }

    public static int[] intArray(int num) {
        int[] r = new int[num];
        for (int i = 0; i < num - 1; i++) {
            r[i] = getRandom().nextInt();
        }
        return r;
    }

    public static int[] intArray(int num, int low) {
        int[] r = new int[num];
        for (int i = 0; i < num - 1; i++) {
            r[i] = getRandom().nextInt(low);
        }
        return r;
    }

    public static int[] intArray(int num, int low, int high) {
        int[] r = new int[num];
        for (int i = 0; i < num - 1; i++) {
            r[i] = getRandom().nextInt(low, high);
        }
        return r;
    }

    public static long[] longArray(int num) {
        return null;
    }

    public static float[] floatArray(int num) {
        return null;
    }

    public static double[] doubleArray(int num) {
        return null;
    }

}
